//
//  FTSmartDeviceConst.h
//  FotileStyle
//
//  Created by wangspc on 2017/5/4.
//  Copyright © 2017年 Fotile. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FTSmartTypes.h"
//#import "FTBaseComponents.h"

#import <FTBaseComponents/FTBaseComponents.h>
//#import "XLinkExportObject.h"


#define setbit(x,y) x|=(1<<y) //将X的第Y位置1
#define clrbit(x,y) x&=~(1<<y) //将X的第Y位清0

#pragma mark - the view skin color key

/// userd by navigation button normal
FOUNDATION_EXTERN NSString *const FTNavigationNormalTintColorKey;

/// Used by navigation button disable
FOUNDATION_EXTERN NSString *const FTNavigationDisableTintColorKey;

/// Used by viewController‘s view background
FOUNDATION_EXTERN NSString *const FTViewBackgroundColorKey;

/// Used by navigation background color
FOUNDATION_EXTERN NSString *const FTNavigationBackgroundColorKey;

/// Used by whiteColor For the project
FOUNDATION_EXTERN NSString *const FTViewColorForWhiteKey;

/// Used by blackColor 
FOUNDATION_EXTERN NSString *const FTViewColorForBlackKey;

/// Used by a little red color
FOUNDATION_EXTERN NSString *const FTViewColorRedKey;

/// Used by message little black color
FOUNDATION_EXTERN NSString *const FTViewDeviceShowBlaceColorkey;


#pragma mark - smartDevice Icon

#pragma mark - smartDevice Storyboard const

/// Used by 厨房 StoryBoard Name
FOUNDATION_EXTERN NSString *const FTKitchenSbName;

/// Used by 蒸箱 StoryBoard Name
FOUNDATION_EXTERN NSString *const FTSteamerSbName;

/// Used by 烤箱 StoryBoard Name
FOUNDATION_EXTERN NSString *const FTOvenSbName;

/// Used by 微波炉 StoryBoard Name
FOUNDATION_EXTERN NSString *const FTMicrowaveOvenSbName;

/// Used by 蒸微一体机 StoryBoard Name
FOUNDATION_EXTERN NSString *const FTSteamMicroMachineSbName;

/// Used by 油烟机 StoryBoard Name
FOUNDATION_EXTERN NSString *const FTHoodSbName;

/// Used by 灶具 StoryBoard Name
FOUNDATION_EXTERN NSString *const FTCookerSbName;

/// Used by 消毒柜 StoryBoard Name
FOUNDATION_EXTERN NSString *const FTSterilizerSbName;

/// Used by 岛式机 StoryBoard Name
FOUNDATION_EXTERN NSString *const FTIsLandHoodsSbName;

/// Used by 洗碗机 StoryBoard Name
FOUNDATION_EXTERN NSString *const FTDishWasherSbName;

/// Used by 智能厨房控制中心IKCC StoryBoard Name
FOUNDATION_EXTERN NSString *const FTIKCCNetSbName;

/// Used by 光影油烟机 StoryBoard Name
FOUNDATION_EXTERN NSString *const FTLightShadowHoodsSbName;

/// Used by 光影蒸箱 StoryBoard Name
FOUNDATION_EXTERN NSString *const FTLightShadowSteamerSbName;

/// Used by 光影微波炉 StoryBoard Name
FOUNDATION_EXTERN NSString *const FTLightShadowMicrowaveOvenSbName;

/// Used by 光影烤箱 StoryBoard Name
FOUNDATION_EXTERN NSString *const FTLightShadowOvenSbName;


/// Return the color for a specified FT...ColorKey
UIColor *FTColor(NSString *colorKey);

/// update the button layer shadow
void FTUpdateButtonShadowLayer(UIButton *shdowButton);
/// update the button highlighted image when the image presses
void FTUpdateButtonHighlighted(UIButton *button);
/// Return className from stroyboard name
NSString *FTSmartClassName(NSString *sbKey);

/// Modify the VCClass for a specified StoryBoardName. (for customization)
void FTVCClassSetClassNameForKey(NSString *key, NSString *className);

/// bundle for resource
NSBundle *FTSmartBundle();
NSBundle *FTSmarDefaultLocaleBundle();

#define FTSmartDefaultLocalizedValue(key) \
[FTSmarDefaultLocaleBundle() localizedStringForKey:key value:@"" table:@"SmartFotileDevice"]

#define FTSmartLocalizedString(key, comment) \
[FTSmartBundle() localizedStringForKey:(key) value:FTSmartDefaultLocalizedValue(key) table:@"SmartFotileDevice"]

#pragma mark - smartDevice Cell

/// smart Device cell width
CGFloat FTDeviceCollectionCellWidth();
/// smart Device cell height 
CGFloat FTDeviceCollectionCellHeight();

/// Go through the device list and get the current product index
NSIndexPath *FTSmartDeviceIndex(NSString *productID);

/// gain the deviceType from productId such as `DeviceTypeSteamer` `DeviceTypeOven`
DeviceType FTSmartDeviceTypeFrom(NSString *productId);

/**
 From device type get the current device name
 
 @param type device type
 @return device icon name
 */
NSString *FTDeviceName(DeviceType type);
/// 获取当前设备的选中图标
UIImage *FTSmartSelDeviceIcon(NSString *productId, BOOL selected);

/**
 支持一键烹饪的智能设备

 @return 一键烹饪数组
 */
FT_INLINE
NSArray *FTAllowSmartCookPIDs() {
    return @[
             @"1607d4b18ec304381607d4b18ec34c01",
             @"1607d6b18eb804381607d6b18eb81801",
             @"1607d6b1450104381607d6b14501ec01",
             @"1607d4b18f2104381607d4b18f212e01",
             @"1607d6b1450004381607d6b14500be01",
             ];
}
/**
 项目总产品的ID 包括所有套系的产品
 
 @return 一键烹饪数组
 */
FT_INLINE
NSArray *FTProductIDS() {
    /// 不同产品的产品ID
    return @[
             @[
                 @"1607d4b18ec304381607d4b18ec34c01",
                 @"1607d4b0902400001607d4b090240001"
                 ],
             @[
                 @"1607d6b18eb804381607d6b18eb81801",
                 @"1607d6b08ff092001607d6b08ff09201"
                 ],
             @[
                 @"1607d6b1450104381607d6b14501ec01",
                 @"1607d4b08ff544001607d4b08ff54401"
                 ],
             @[
                 @"1607d6b1920b04381607d6b1920b9001",
                 @"1607d6b08fea5c001607d6b08fea5c01"
                 ],
             @[@"1607d4b18f2104381607d4b18f212e01"],
             @[@"1607d4b1920d04381607d4b1920d6e01"],
             @[@"1607d4b077ca1a001607d4b077ca1a01"],
             @[@"1607d6b1450004381607d6b14500be01"],
             @[@"1607d4b07f982a001607d4b07f982a01"],
             @[@"1607d6b05791c0001607d6b05791c001"],
             ];
}


/**
 所有套系设备名称
 ### 套系显示名称
 * [["蒸箱","光影蒸箱"],["烤箱","光影烤箱"],["微波炉","光影微波炉"],["烟机","光影烟机"],["灶具"],["消毒柜"],["洗碗机"],["一体机"],["IKCC"]]
 @return 返回Array<DeviceName>
 */
FT_INLINE
NSArray *FTProductNameArray() {
    return  @[
              @[FTSmartLocalizedString(@"SMART_DEVICE_TYPE_STREAM", nil),
                FTSmartLocalizedString(@"SMART_DEVICE_TYPE_SHADOW_STREAM", nil)],
              @[FTSmartLocalizedString(@"SMART_DEVICE_TYPE_OVEN", nil),
                FTSmartLocalizedString(@"SMART_DEVICE_TYPE_SHADOW_OVEN", nil)],
              @[FTSmartLocalizedString(@"SMART_DEVICE_TYPE_MICROWAVE_OVEN", nil),
                FTSmartLocalizedString(@"SMART_DEVICE_TYPE_SHADOW_MICROWAVE_OVEN", nil)],
              @[FTSmartLocalizedString(@"SMART_DEVICE_TYPE_HOOD", nil),
                FTSmartLocalizedString(@"SMART_DEVICE_TYPE_SHADOW_HOOD", nil)],
              @[FTSmartLocalizedString(@"SMART_DEVICE_TYPE_COOKER", nil)],
              @[FTSmartLocalizedString(@"SMART_DEVICE_TYPE_STERILIZER", nil
                                       )],
              @[FTSmartLocalizedString(@"SMART_DEVICE_TYPE_DISHWASHER", nil
                                       )],
              @[FTSmartLocalizedString(@"SMART_DEVICE_TYPE_STREAM_MICROWAVE", nil
                                        )],
              @[FTSmartLocalizedString(@"SMART_DEVICE_TYPE_IKCC", nil)],
              @[@"岛式机"]
              ];
}

/**
 具体设备对应的数据模型映射

 @return 模型数组
 */
FT_INLINE
NSArray *FTModelNameArray() {
    return @[
             @[@"SteamerModel",@"LightShadowSteamerModel"],
             @[@"OvenModel",@"OvenModel"],
             @[@"MicrowaveOvenModel",@"MicrowaveOvenModel"],
             @[@"RangehoodModel",@"RangehoodModel"],
             @[@"CookerModel"],
             @[@"SterilizerModel"],
             @[@"DishWasherModel"],
             @[@"SteamMicroMachineModel"],
             @[@"FTIKCCModel"],
             @[@"IslandHoodModel"],
             ];
}


/**
 智能设备搜索图标

 @return image icon array for the device 
 */
FT_INLINE
NSArray *FTProductPicIconArray() {
    return @[@"Kitchenware_steamer",@"Kitchenware_oven",@"Kitchenware_microwave_oven",@"Kitchenware_rangehood",@"Kitchenware_stove",@"Kitchenware_sterilizer",@"Kitchenware_dishwasher",@"Kitchenware_steam_machine",@"kitchenware_wangguan",@"Kitchenware_rangehood"];
}

